package com.dondedesigns.eh.controller.bullets;

import java.util.Arrays;
import java.util.List;

import com.dondedesigns.eh.controller.index.UserAware;
import com.dondedesigns.eh.persistence.BlUser;
import com.dondedesigns.eh.persistence.Gun;
import com.dondedesigns.eh.persistence.User;
import com.dondedesigns.eh.persistence.dao.BlUserDAO;
import com.opensymphony.xwork2.ActionSupport;

public class UpdateBulletsPage extends ActionSupport implements UserAware {
	
	private User user;
	private BlUser blUser;
	private String blUserId;
	
	private BlUserDAO blUserDAO;
	
	@Override
	public String execute() throws Exception {
		blUser = blUserDAO.find(Long.parseLong(blUserId));
		return SUCCESS;
	}

	@Override
	public void setUser(User user) {
		this.user = user;
	}
	
	public BlUser getBlUser() {
		return blUser;
	}
	
	public void setBlUser(BlUser blUser) {
		this.blUser = blUser;
	}

	public String getBlUserId() {
		return blUserId;
	}

	public void setBlUserId(String blUserId) {
		this.blUserId = blUserId;
	}
	
	public List<Gun> getListGuns() {
		return Arrays.asList(Gun.values());

	}
	
	public void setBlUserDAO(BlUserDAO blUserDAO) {
		this.blUserDAO = blUserDAO;
	}
}
